<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>利用函数求任意一个数组中的最大值</title>
    <script>
        function getArrMax(arr){
            var max = arr[0];
            for(var i = 1; i <=arr.length;i++){
                if(arr[i]>max){
                    max = arr[i];
                }
            }
            return max;
        }
        console.log(getArrMax([5,2,99,101,67,77]));

    </script>
</head>
<body>

</body>
</html>